home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / stinger2.zip / STINGER.QC < prev    next >
Text File  |  1996-09-17  |  4KB  |  102 lines

  1. void() StingerElec;
  2. void() W_LaunchStinger;
  3. void(entity inflictor, entity attacker, float rangee, entity ignore) T_RadiusElectrocute;
  4. void() StingerTouch =
  5. {
  6.         if (other.takedamage)
  7.          {
  8.           sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);
  9.           return;
  10.          }
  11.  
  12.         sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);
  13.         if (self.velocity == '0 0 0')
  14.                 self.avelocity = '0 0 0';
  15. };
  16.  
  17. void() StingerElec =
  18. {
  19.         if (self.waterlevel > 0)
  20.         {
  21.          T_RadiusElectrocute (self, self.owner, 999999, world);
  22.          sound (self, CHAN_WEAPON, "misc/power.wav", 1, ATTN_NORM);
  23.          remove (self);
  24.          return;
  25.         }
  26.         else
  27.         {
  28.         return;
  29.         }
  30. };
  31.  
  32. void() W_LaunchStinger =
  33. {
  34.         if (self.ammo_cells < 25)
  35.         {
  36.         return;
  37.         }
  38.  
  39.         local   entity missile, mpuff;
  40.         self.currentammo = self.ammo_cells = self.ammo_cells - 25;
  41.         self.punchangle_x = -2;
  42.         missile = spawn ();
  43.         missile.owner = self;
  44.         missile.movetype = MOVETYPE_BOUNCE;
  45.         missile.solid = SOLID_BBOX;
  46.         missile.classname = "stinger";
  47.         makevectors (self.v_angle);
  48.         if (self.v_angle_x)
  49.                 missile.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
  50.         else
  51.         {
  52.                 missile.velocity = aim(self, 10000);
  53.                 missile.velocity = missile.velocity * 600;
  54.                 missile.velocity_z = 200;
  55.         }
  56.         bprint (self.netname);
  57.         bprint (" tosses a stinger!\n");
  58.         missile.avelocity = '300 300 300';
  59.         missile.angles = vectoangles(missile.velocity);
  60.         missile.touch = StingerTouch;
  61.         missile.nextthink = time + 4;
  62.         missile.think = StingerElec;
  63.         setmodel (missile, "progs/nbomb.mdl");
  64.         setsize (missile, '0 0 0', '0 0 0');
  65.         setorigin (missile, self.origin);
  66. };
  67. void(entity inflictor, entity attacker, float rangee, entity ignore) T_RadiusElectrocute =
  68. {
  69.         local   entity  head, timer;
  70.         local   vector  org;
  71.         local   string  st;
  72.  
  73.         head = findradius(inflictor.origin,rangee);
  74.  
  75.         while (head)
  76.         {
  77.                 if (head != ignore)
  78.                 {
  79.                         if (head.takedamage)
  80.                         {
  81.                                         if (head.classname != "player")
  82.                                         {
  83.                                                 if(head.flags & FL_ONGROUND)
  84.                                                         head.flags = head.flags - FL_ONGROUND;
  85.                                         }
  86.                                         else if (head.waterlevel > 0)
  87.                                         {
  88.                                         T_Damage (head, inflictor, attacker, 9999);
  89.                                         head.super_time = 1;
  90.                                         head.super_damage_finished = time + 2;
  91.                                         return;
  92.                                         }
  93.                                         else
  94.                                         {
  95.                                         centerprint (head, "There's a barbeque in the pool!\n");
  96.                                         return;
  97.                                         }
  98.                           }
  99.                 }
  100.                 head = head.chain;
  101.         }
  102. };